package Q1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int m = scanner.nextInt();

        if (n - m == 0) {
            System.out.println(1.00000 + " " + 5.00000);
        } else {
            int sum = 0;
            for (int i = 0; i < n - m; i++) {
                sum += scanner.nextInt();
            }

            double max = sum + m * 5;
            double min = sum + m;
            System.out.printf("%.5f", min / n);
            System.out.print(" ");
            System.out.printf("%.5f", max / n);
        }
    }
}
